﻿<%@ Page Title="" Language="C#" MasterPageFile="~/form/MasterPage.Master" AutoEventWireup="true" CodeBehind="Venta.aspx.cs" Inherits="web.form.Venta" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            width: 82%;
        }
        .style3
        {
            width: 603px;
        }
        .style4
        {
            width: 84px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <br />
    <h1>Venta</h1>
    <hr />
    <br />
    <asp:Panel ID="PnlCompra" runat="server">
        <asp:Label ID="lbl_fecha" runat="server"></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="lbl_empleado" runat="server" Text="1"></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="cmbEmpleado" runat="server" CssClass="combo">
        </asp:DropDownList>
        <br />
        Código
        <asp:TextBox ID="txt_filtro" runat="server" CssClass="text" MaxLength="20"></asp:TextBox>
        <asp:Button ID="Filtrar" runat="server" CssClass="boton" 
            onclick="Filtrar_Click" Text="Filtrar" />
        <br />
        <br />
        <asp:GridView ID="grdProductos" runat="server" EnablePersistedSelection="True"
            ForeColor="#333333" GridLines="None" 
            onselectedindexchanged="grdProductos_SelectedIndexChanged" Width="800px" 
            AllowPaging="True" onpageindexchanging="grdProductos_PageIndexChanging">
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#78bbe6" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#78bbe6" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
            <Columns>
                <asp:CommandField SelectText="Comprar" ShowSelectButton="True" />
                <asp:BoundField DataField="Codigo" HeaderText="Codigo" ReadOnly="True" 
                    Visible="False" />
            </Columns>
        </asp:GridView>
        <br />
        <asp:Label ID="lbl_producto" runat="server" CssClass="text" Text=" ." 
            Width="450px"></asp:Label>
        &nbsp;Cantidad&nbsp;&nbsp;
        <asp:TextBox ID="txtCantidad" runat="server" CssClass="text" 
            ValidationGroup="agregarVenta" Width="50px" MaxLength="10"></asp:TextBox>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="cmd_agregar" runat="server" CssClass="boton" 
            onclick="cmd_agregar_Click" Text="Agregar" ValidationGroup="agregarVenta" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
            ControlToValidate="txtCantidad" ErrorMessage="Ingrese una Cantidad" 
            ValidationGroup="agregarVenta"></asp:RequiredFieldValidator>
        <br />
        <br />
        <asp:GridView ID="grdVenta" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" ForeColor="#333333" GridLines="None" style="margin-right: 1px" 
            Width="800px">
            <Columns>
                <asp:BoundField DataField="Id" HeaderText="Id" />
                <asp:BoundField DataField="Codigo" HeaderText="Producto" />
                <asp:BoundField DataField="descripcion" HeaderText="Descripcion" />
                <asp:BoundField DataField="PrecioVenta" HeaderText="Precio Unitario" />
                <asp:BoundField DataField="cantidad" HeaderText="Cantidad" />
                <asp:BoundField DataField="total" HeaderText="Total" />
            </Columns>
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#78bbe6" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#78bbe6" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>
        <br />
        <table class="style1">
            <tr>
                <td class="style3">
                    &nbsp;</td>
                <td class="style4">
                    <asp:Label ID="Label1" runat="server" Text="Total" Visible="False"></asp:Label>
                </td>
                <td>
                    <asp:Label ID="lbl_total" runat="server" CssClass="text" Width="70px" 
                        Visible="False"></asp:Label>
                </td>
            </tr>
        </table>
        <asp:Button ID="cmd_Confirmar" runat="server" CssClass="boton-right" 
            onclick="cmd_Confirmar_Click" Text="Confirmar" Visible="False" />
        <br />
    </asp:Panel>

    <br />

    <asp:Panel ID="pnlPago" runat="server">
    <h2>Pago</h2>
        <p>
            Total a pagar:&nbsp;
            <asp:Label ID="lbl_totalAPagar" runat="server"></asp:Label>
        </p>
            Forma de pago:&nbsp;<asp:RequiredFieldValidator 
            ID="RequiredFieldValidator3" runat="server" ControlToValidate="rbl_formaPago" 
            ErrorMessage="*Seleccione una forma de pago" ValidationGroup="agregarPago"></asp:RequiredFieldValidator>
&nbsp;<asp:RadioButtonList ID="rbl_formaPago" runat="server" 
            onselectedindexchanged="RadioButtonList1_SelectedIndexChanged" 
            AutoPostBack="True">
            <asp:ListItem>Contado</asp:ListItem>
            <asp:ListItem>Tarjeta</asp:ListItem>
        </asp:RadioButtonList>
            <asp:DropDownList ID="cmb_tarjetas" runat="server" CssClass="combo" 
            Width="251px">
            </asp:DropDownList>

        &nbsp;&nbsp;&nbsp; Cuotas:&nbsp; &nbsp;<asp:TextBox ID="txtCuotas" 
            runat="server" CssClass="text" ValidationGroup="AgregarPago" MaxLength="2">1</asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
            ControlToValidate="txtCuotas" ErrorMessage="*Ingrese la cantidad de cuotas" 
            ValidationGroup="agregarPago"></asp:RequiredFieldValidator>
        <br />
        <br />
        Monto:&nbsp;&nbsp;<asp:TextBox ID="txtMonto" runat="server" CssClass="text" 
            Width="97px" MaxLength="20"></asp:TextBox>
&nbsp;
        <asp:Button ID="cmd_Aceptar" runat="server" CssClass="boton" Text="Aceptar" 
            onclick="cmd_Aceptar_Click" ValidationGroup="agregarPago" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
            ControlToValidate="txtMonto" ErrorMessage="*Ingrese el monto a abonar" 
            ValidationGroup="agregarPago"></asp:RequiredFieldValidator>
        <br />
        <br />
        <asp:GridView ID="grdPago" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" ForeColor="#333333" GridLines="None">
            <Columns>
                <asp:BoundField DataField="formaPago" HeaderText="Forma Pago" />
                <asp:BoundField DataField="tar" HeaderText="Tarjeta" />
                <asp:BoundField DataField="monto" HeaderText="Monto" />
                <asp:BoundField DataField="cuota" HeaderText="Cuotas" />
            </Columns>
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#78bbe6" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#78bbe6" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#E9E7E2" />
            <SortedAscendingHeaderStyle BackColor="#506C8C" />
            <SortedDescendingCellStyle BackColor="#FFFDF8" />
            <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        </asp:GridView>

        <br />
        <asp:Button ID="cmd_ConfirmVenta" runat="server" CssClass="boton" 
            onclick="cmd_ConfirmVenta_Click" Text="Confirmar" Visible="False" />
        <br />

    </asp:Panel>
    <br />
</asp:Content>
